package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        Integer value =  map.put("语文",98);
        System.out.println(value);
        map.put("数学",95);
        map.put("英语",77);
        map.put("物理",95);
        map.put("化学",13);
        value =  map.put("化学",100);
        System.out.println(value);
        int size = map.size();
        System.out.println("size:" +size);
        System.out.println(map);
        value = map.get("化学");
        System.out.println(value);
        value = map.remove("英语");//删除
        System.out.println(value);
        System.out.println(map);
        boolean k = map.containsKey("语文");
        boolean v = map.containsValue(95);
        System.out.println(k);
        System.out.println(v);
        map.clear();
        System.out.println(map);
    }
}
